# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks-old
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kirigami2
pkgver=5.116.0
pkgrel=1
pkgdesc="A QtQuick based components set"
arch="all !armhf" # armhf blocked by qt5-qtdeclarative
url="https://community.kde.org/Frameworks"
license="LGPL-2.0-only"
depends="qt5-qtsvg"
depends_dev="
	kconfig5-dev
	kcoreaddons5-dev
	kwindowsystem5-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtquickcontrols2-dev
	qt5-qtsvg-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	qt5-qttools-dev
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-libs $pkgname-lang"
_repo_url="https://invent.kde.org/frameworks/kirigami.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kirigami2-$pkgver.tar.xz"

case "$CARCH" in
	armv7) options="!check" ;; # Too many broken atm (SEGFAULT), needs looking into
esac

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DKDE_INSTALL_LIBDIR=lib \
		-DBUILD_TESTING=ON \
		-DBUILD_EXAMPLES=OFF
	cmake --build build
}

check() {
	xvfb-run -a ctest --test-dir build --output-on-failure -E "(tst_(lists|)keynavigation|wheelhandler/tst_scrolling).qml"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
bb1f7525cb77dc2849bc9782be9b4522b4559b78e8ad88c9cd9953a6d9736cbe63a33a76fadebd9a1fb04f15007e5141aa465991b99117f7c2f26e09c722b66e  kirigami2-5.116.0.tar.xz
"
